﻿using System;

namespace UtfprLibrary.EntityFramework.ComponentModel {
    /// <summary>
    /// Provides data for the <see cref="DataError"/> event.
    /// </summary>
    public class DataErrorEventArgs : EventArgs {
        /// <summary>
        /// Initializes a new instance of a <see cref="DataErrorEventArgs"/>.
        /// </summary>
        /// <param name="x"><see cref="Exception"/> that triggered the event.</param>
        public DataErrorEventArgs(Exception x) {
            Exception = x;
        }

        /// <summary>
        /// Gets or sets the <see cref="Exception"/> that triggered the event.
        /// </summary>
        public Exception Exception { get; set; }

        /// <summary>
        /// Whether the error was handled and the source exception should be ignored.
        /// </summary>
        public bool Handled { get; set; }
    }
}
